import request from '@/utils/request'

/**
 * @param {Object} params 查找参数
 */
export function fetchList(data) {
    return request({
        url: '/post/list',
        method: 'post',
        data: data
    })
}

/**
 * 获得聚焦信息
 */
export function fetchFocus() {
    return request({
        url: '/focus/list',
        method: 'get',
        params: {}
    })
}

export function fetchCategory() {
    return request({
        url: '/category',
        method: 'get',
        params: {}
    })
}

export function fetchFriend() {
    return request({
        url: '/friend',
        method: 'get',
        params: {}
    })
}

export function fetchSocial() {
    return request({
        url: '/social',
        method: 'get',
        params: {}
    });
}

export function fetchSiteInfo() {
    return request({
        url: '/site',
        method: 'get',
        params: {}
    })
}

/**
 * 文章评论
 */
export function fetchComment(id) {
    return request({
        url: '/comment',
        method: 'get',
        params: id
    })
}
/**
 * @param {Object} params 提交参数
 */
export function submitComment(params) {
	return request({
		url: '/submit/comment',
		method: 'post',
		data: params
	})
}

/**
 * @param {Object} id 文章id
 */
export function fetchArticles(id) {
	return request({
		url: '/article',
		method: 'get',
		params: {'id':id}
	})
}

/**
 * 获取关于页面信息
 */
export function fetchAbout() {
	return request({
		url: '/about',
		method: 'get',
		params:{}
	})
}

/**
 * 获取资源信息
 */
export function fetchResources() {
	return request({
		url: 'resources',
		method: 'get',
		params:{}
	})
}